package com.doit.学;

import java.io.*;

public class test03 {
    public static void main(String[] args) throws IOException {
        InputStreamReader gbk = new InputStreamReader(new FileInputStream("d:\\work\\编码\\编码GBK.txt"), "GBK");
        OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream("d:\\work\\编码\\编码utf.txt"));

        int len ;
        char[] chars = new char[1024];
        while ((len = gbk.read(chars))!=-1){
            System.out.println(new String(chars,0,len));
            fw.write(chars,0,len);
            fw.flush();
        }

        fw.close();
        gbk.close();

    }
}
